/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package chatroom.com.frame;

import chatroom.com.chatEvent.Chat;
import chatroom.com.chatEvent.ChatFilter;
import chatroom.com.chatEvent.FastChat;
import chatroom.com.clientserver.ChatServer;
import chatroom.com.entity.MessageModel;
import chatroom.com.util.DateUtil;
import chatroom.com.util.FileForJiluUtil;
import java.awt.Color;
import java.awt.event.KeyEvent;
import java.io.*;
import java.net.Socket;
import javax.swing.*;

/**
 *
 * @author Administrator
 */
public class ChatFrame extends javax.swing.JFrame implements Runnable {

    BufferedReader in; // 输入流
    PrintWriter out; // 输出流
    MessageModel msgg = null;
    private boolean privateTalkFlag = false;
    private String myname;
    private DefaultListModel listUser = new DefaultListModel();
    private boolean isVisibel = true;
    private int caozuo = 1;//为1：表示与对方聊天。 为2表示，查看用户信息。为3表示发送文件。为4，表示踢人

    /**
     * Creates new form ChatFrame
     */
    public ChatFrame() {

        initComponents();
    }

    public ChatFrame(String nick, int isGuanliyuan) {
        super(nick + "的聊天室");

        msgg = new MessageModel();
        myname = nick;
        initComponents();
        if (isGuanliyuan == 1) {
            tiren.setVisible(true);
        }
    }

    /**
     * 功能：获得连接
     *
     * @param in
     * @param out
     */
    public void connect(BufferedReader in, PrintWriter out) {
        // 获得输入、输出流
        this.in = in;
        this.out = out;
        // 获得我自己的名字
        Thread th = new Thread(this);
        th.start();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        jsp1 = new javax.swing.JScrollPane();
        gongliao = new javax.swing.JTextPane();
        jScrollPane4 = new javax.swing.JScrollPane();
        siliao = new javax.swing.JTextPane();
        jScrollPane3 = new javax.swing.JScrollPane();
        message = new javax.swing.JTextArea();
        songhua = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        huacount = new javax.swing.JTextField(2);
        send = new javax.swing.JButton();
        hanhua = new javax.swing.JButton();
        jLabel5 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        userList = new javax.swing.JList(listUser);
        usercount = new javax.swing.JLabel();
        jPanel7 = new javax.swing.JPanel();
        chakanyonghu = new javax.swing.JRadioButton();
        liaotian = new javax.swing.JRadioButton();
        jRadioButton3 = new javax.swing.JRadioButton();
        tiren = new javax.swing.JRadioButton();
        jPanel2 = new javax.swing.JPanel();
        act = new javax.swing.JLabel();
        dongzuo = new javax.swing.JComboBox();
        toWho = new javax.swing.JComboBox();
        aaaaa = new javax.swing.JLabel();
        biaoqing = new javax.swing.JButton();
        jietu = new javax.swing.JButton();
        jilu = new javax.swing.JButton();
        isSiliao = new javax.swing.JCheckBox();
        xzziti = new javax.swing.JButton();
        font = new javax.swing.JPanel();
        ziti = new javax.swing.JComboBox();
        yanse = new javax.swing.JComboBox();
        daxiao = new javax.swing.JComboBox();
        yangshi = new javax.swing.JComboBox();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        clear = new javax.swing.JButton();
        systishi = new javax.swing.JLabel();
        guanggao = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBackground(new java.awt.Color(255, 255, 255));
        setResizable(false);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        jPanel1.setLayout(null);

        jsp1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
        jsp1.setEnabled(false);
        jsp1.setFocusCycleRoot(true);
        jsp1.getVerticalScrollBar().setValue(jsp1.getVerticalScrollBar().getMaximum());

        gongliao.setBorder(javax.swing.BorderFactory.createTitledBorder("公聊区域"));
        gongliao.setEditable(false);
        gongliao.setFont(new java.awt.Font("楷体", 0, 12)); // NOI18N
        gongliao.setAutoscrolls(true);
        gongliao.setDragEnabled(true);
        gongliao.setSelectionStart(gongliao.getText().length());
        jsp1.setViewportView(gongliao);

        jPanel1.add(jsp1);
        jsp1.setBounds(0, 0, 453, 236);

        jScrollPane4.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
        jScrollPane4.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        siliao.setBorder(javax.swing.BorderFactory.createTitledBorder("私聊区域"));
        siliao.setEditable(false);
        siliao.setFont(new java.awt.Font("楷体", 0, 12)); // NOI18N
        jScrollPane4.setViewportView(siliao);

        jPanel1.add(jScrollPane4);
        jScrollPane4.setBounds(0, 242, 453, 132);

        message.setColumns(20);
        message.setRows(5);
        message.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                messageKeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                messageKeyReleased(evt);
            }
        });
        jScrollPane3.setViewportView(message);

        jPanel1.add(jScrollPane3);
        jScrollPane3.setBounds(0, 462, 309, 91);

        songhua.setText("送花");
        songhua.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                songhuaActionPerformed(evt);
            }
        });
        jPanel1.add(songhua);
        songhua.setBounds(396, 495, 57, 23);

        jLabel1.setText("朵");
        jPanel1.add(jLabel1);
        jLabel1.setBounds(366, 499, 12, 15);

        jLabel2.setBackground(new java.awt.Color(204, 204, 204));
        jLabel2.setForeground(new java.awt.Color(204, 0, 0));
        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/chatroom/resource/hua.png"))); // NOI18N
        jLabel2.setText("送花");
        jLabel2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabel2MouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabel2MouseExited(evt);
            }
        });
        jPanel1.add(jLabel2);
        jLabel2.setBounds(315, 462, 70, 23);
        jPanel1.add(huacount);
        huacount.setBounds(315, 496, 41, 21);

        send.setText("发送");
        send.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                sendActionPerformed(evt);
            }
        });
        jPanel1.add(send);
        send.setBounds(315, 524, 57, 23);

        hanhua.setText("喇叭");
        hanhua.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                hanhuaActionPerformed(evt);
            }
        });
        jPanel1.add(hanhua);
        hanhua.setBounds(396, 524, 57, 23);

        jLabel5.setText("广告信息：");
        jPanel1.add(jLabel5);
        jLabel5.setBounds(0, 570, 60, 23);

        userList.setBorder(javax.swing.BorderFactory.createTitledBorder("在线用户"));
        userList.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                userListMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                userListMouseExited(evt);
            }
        });
        userList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
                userListValueChanged(evt);
            }
        });
        jScrollPane2.setViewportView(userList);

        jPanel1.add(jScrollPane2);
        jScrollPane2.setBounds(459, 0, 130, 374);

        usercount.setForeground(new java.awt.Color(255, 0, 0));
        usercount.setText("在线人数：");
        jPanel1.add(usercount);
        usercount.setBounds(469, 408, 90, 15);

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder("操作方式"));

        buttonGroup1.add(chakanyonghu);
        chakanyonghu.setText("查看用户");
        chakanyonghu.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                chakanyonghuMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                chakanyonghuMouseExited(evt);
            }
        });
        chakanyonghu.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                chakanyonghuItemStateChanged(evt);
            }
        });

        buttonGroup1.add(liaotian);
        liaotian.setSelected(true);
        liaotian.setText("聊天对象");
        liaotian.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                liaotianItemStateChanged(evt);
            }
        });

        buttonGroup1.add(jRadioButton3);
        jRadioButton3.setText("发送文件");
        jRadioButton3.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jRadioButton3MouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jRadioButton3MouseExited(evt);
            }
        });
        jRadioButton3.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jRadioButton3ItemStateChanged(evt);
            }
        });

        buttonGroup1.add(tiren);
        tiren.setText("踢人");
        tiren.setVisible(false);
        tiren.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                tirenMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                tirenMouseExited(evt);
            }
        });
        tiren.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                tirenItemStateChanged(evt);
            }
        });

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(chakanyonghu, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(liaotian, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jRadioButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tiren))
                .addContainerGap(37, Short.MAX_VALUE))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addComponent(liaotian)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(chakanyonghu)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jRadioButton3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(tiren))
        );

        jPanel1.add(jPanel7);
        jPanel7.setBounds(459, 429, 130, 130);

        jPanel2.setFocusTraversalPolicyProvider(true);
        jPanel2.setPreferredSize(new java.awt.Dimension(437, 30));

        act.setText("动作：");

        dongzuo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "无", "激动地", "开心地", "伤心地", "失望地" }));

        toWho.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "所有人" }));

        aaaaa.setText("对：");

        biaoqing.setIcon(new javax.swing.ImageIcon(getClass().getResource("/chatroom/resource/biaoqing.png"))); // NOI18N
        biaoqing.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                biaoqingMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                biaoqingMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                biaoqingMouseExited(evt);
            }
        });

        jietu.setIcon(new javax.swing.ImageIcon(getClass().getResource("/chatroom/resource/wenjian.png"))); // NOI18N
        jietu.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jietuMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jietuMouseExited(evt);
            }
        });

        jilu.setBackground(new java.awt.Color(204, 204, 204));
        jilu.setIcon(new javax.swing.ImageIcon(getClass().getResource("/chatroom/resource/jilu.png"))); // NOI18N
        jilu.setMaximumSize(new java.awt.Dimension(28, 21));
        jilu.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jiluMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jiluMouseExited(evt);
            }
        });
        jilu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jiluActionPerformed(evt);
            }
        });

        isSiliao.setText("私聊");
        isSiliao.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                isSiliaoStateChanged(evt);
            }
        });

        xzziti.setIcon(new javax.swing.ImageIcon(getClass().getResource("/chatroom/resource/ziti.png"))); // NOI18N
        xzziti.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                xzzitiMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                xzzitiMouseExited(evt);
            }
        });
        xzziti.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                xzzitiActionPerformed(evt);
            }
        });

        font.setVisible(false);
        font.setVisible(false);

        ziti.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "宋体", "黑体", "Dialog", "Gulim" }));

        yanse.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "黑色", "红色", "蓝色", "黄色", "绿色" }));

        daxiao.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "12", "14", "16", "18", "20", "22", "30" }));

        yangshi.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "常规", "斜体", "粗体", "粗斜体" }));

        jLabel9.setText("字体：");

        jLabel10.setText("颜色：");

        jLabel11.setText("大小：");

        jLabel12.setText("样式：");

        javax.swing.GroupLayout fontLayout = new javax.swing.GroupLayout(font);
        font.setLayout(fontLayout);
        fontLayout.setHorizontalGroup(
            fontLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(fontLayout.createSequentialGroup()
                .addComponent(jLabel9)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(ziti, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel10)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(yanse, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(daxiao, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel12)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(yangshi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(28, Short.MAX_VALUE))
        );
        fontLayout.setVerticalGroup(
            fontLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(fontLayout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addGroup(fontLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ziti, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(yanse, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(daxiao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(yangshi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9)
                    .addComponent(jLabel10)
                    .addComponent(jLabel11)
                    .addComponent(jLabel12)))
        );

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(xzziti, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(11, 11, 11)
                .addComponent(biaoqing, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jietu, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(10, 10, 10)
                .addComponent(jilu, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(10, 10, 10)
                .addComponent(act)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(dongzuo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(aaaaa)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(toWho, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(isSiliao, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(26, 26, 26))
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(font, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(1, 1, 1)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jilu, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(dongzuo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(act)
                        .addComponent(aaaaa)
                        .addComponent(toWho, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(isSiliao))
                    .addComponent(jietu, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(biaoqing, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(xzziti, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(font, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jPanel1.add(jPanel2);
        jPanel2.setBounds(0, 404, 450, 52);

        clear.setText("清屏");
        clear.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                clearActionPerformed(evt);
            }
        });
        jPanel1.add(clear);
        clear.setBounds(395, 462, 57, 23);

        systishi.setBackground(new java.awt.Color(204, 204, 255));
        systishi.setFont(new java.awt.Font("楷体_GB2312", 0, 14)); // NOI18N
        systishi.setForeground(new java.awt.Color(255, 0, 0));
        systishi.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        systishi.setText("聊天室欢迎您的加入，祝您聊天愉快");
        jPanel1.add(systishi);
        systishi.setBounds(0, 377, 568, 26);
        jPanel1.add(guanggao);
        guanggao.setBounds(60, 570, 520, 20);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 596, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 592, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void sendActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sendActionPerformed
        JScrollBar jsb = jsp1.getVerticalScrollBar();
        System.out.println(jsb.getValue());
        send();
    }//GEN-LAST:event_sendActionPerformed

    private void xzzitiMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_xzzitiMouseEntered
        systishi.setText("鼠标点击可以更换字体。");
    }//GEN-LAST:event_xzzitiMouseEntered

    private void xzzitiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_xzzitiActionPerformed
        if (isVisibel) {
            font.setVisible(true);
            isVisibel = false;
        } else {
            font.setVisible(false);
            isVisibel = true;
        }

    }//GEN-LAST:event_xzzitiActionPerformed

    private void userListMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_userListMouseEntered
        systishi.setText("请先选中下面的操作选项按钮，双击鼠标进行相关操作。");
    }//GEN-LAST:event_userListMouseEntered

    private void userListMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_userListMouseExited
        systishi.setText("聊天室欢迎您的加入，祝您聊天愉快");
    }//GEN-LAST:event_userListMouseExited

    private void xzzitiMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_xzzitiMouseExited
        systishi.setText("聊天室欢迎您的加入，祝您聊天愉快");
    }//GEN-LAST:event_xzzitiMouseExited

    private void biaoqingMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_biaoqingMouseEntered
        systishi.setText("点击可以选择表情");
    }//GEN-LAST:event_biaoqingMouseEntered

    private void biaoqingMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_biaoqingMouseExited
        systishi.setText("聊天室欢迎您的加入，祝您聊天愉快");
    }//GEN-LAST:event_biaoqingMouseExited

    private void jietuMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jietuMouseEntered
        systishi.setText("按住Ctrl+alt+Q可以进行截图");
    }//GEN-LAST:event_jietuMouseEntered

    private void jietuMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jietuMouseExited
        systishi.setText("聊天室欢迎您的加入，祝您聊天愉快");
    }//GEN-LAST:event_jietuMouseExited

    private void jiluMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jiluMouseEntered
        systishi.setText("点击可以查看聊天记录");
    }//GEN-LAST:event_jiluMouseEntered

    private void jiluMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jiluMouseExited
        systishi.setText("聊天室欢迎您的加入，祝您聊天愉快");
    }//GEN-LAST:event_jiluMouseExited

    private void biaoqingMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_biaoqingMouseClicked
        BqFrame bf = new BqFrame(message);
        bf.setLocationRelativeTo(biaoqing);
        bf.setSize(180, 165);
        bf.setVisible(true);
    }//GEN-LAST:event_biaoqingMouseClicked

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        Chat.shutDown(out);
    }//GEN-LAST:event_formWindowClosing

    private void hanhuaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hanhuaActionPerformed
        message.setText(FastChat.getMessage(myname));
        send();
    }//GEN-LAST:event_hanhuaActionPerformed

    private void clearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clearActionPerformed
        gongliao.setText("");
        siliao.setText("");
    }//GEN-LAST:event_clearActionPerformed

    private void messageKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_messageKeyPressed
        if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
            send();
        }
    }//GEN-LAST:event_messageKeyPressed

    private void messageKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_messageKeyReleased
        if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
            message.setText("");// 清空输入框
        }
    }//GEN-LAST:event_messageKeyReleased

    private void userListValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_userListValueChanged
        if (evt.getValueIsAdjusting()) {
            if (caozuo == 1) {// 用于选择对谁说话
                try {
                    String select = (String) userList.getSelectedValue();
                    System.out.println("我想对这个人:" + select + "说话");
                    if (select != null) { // 确保选择非空
                        String[] userInfo = select.split("〖");
                        String name = userInfo[0].trim(); // 提取名字

                        if (!name.equals(this.myname)) { // 不能添加自己
                            int count = this.toWho.getItemCount();
                            for (int i = 0; i < count; i++) {
                                this.toWho.setSelectedIndex(i);// 选择第i项
                                String strName = (String) toWho.getSelectedItem();

                                if (name.equals(strName)) { // 如果已经在列表中，就复合框中选中，所以要确保没有重名
                                    return;
                                }
                            }
                            // 如果没有添加，就会执行下面语句 添加
                            this.toWho.addItem(name);
                            count = this.toWho.getItemCount();
                            this.toWho.setSelectedIndex(count - 1);
                        }
                    }
                } catch (Exception ee) {
                    System.out.println("发生错误 在valueChanged " + ee);
                }
            } else if (caozuo == 2)// seauser选中时候，向服务器发送查看用户信息请求，用于浏览用户的信息，显示在用户信息栏
            {
                System.out.println("我想要查看该用户的个人信息");
                try {
                    String select = (String) userList.getSelectedValue();
                    if (select != null) { // 确保选择非空
                        String[] userInfo = select.split("〖");
                        String name = userInfo[0].trim(); // 提取名字
                        System.out.println("我想要查看那个人的名字为：" + name);
                        out.println("lookUserByNick" + "&" + name + "&" + myname);
                        out.flush();

                    }
                } catch (Exception ee) {
                    System.out.println("发生错误 在valueChanged " + ee);

                }
            } else if (caozuo == 3) {//发送文件
                String select = (String) userList.getSelectedValue();
                if (select != null) { // 确保选择非空
                    String[] userInfo = select.split("〖");
                    String name = userInfo[0].trim(); // 提取名字
                    System.out.println("我想对她发送文件" + name);
                    if (name.equals(myname)) { // 如果已经在列表中，就复合框中选中，所以要确保没有重名
                        return;
                    }
                    out.println("getIp&" + name);
                    out.flush();

                }
            } else if (caozuo == 4) {//踢人
            }
        }
    }//GEN-LAST:event_userListValueChanged

    private void isSiliaoStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_isSiliaoStateChanged
        if (isSiliao.isSelected()) {
            privateTalkFlag = true;
            systishi.setText("选中后可以与他/她私聊哦");
        } else {
            privateTalkFlag = false;
            systishi.setText("心缘聊天室欢迎您的加入，祝您聊天愉快");
        }
    }//GEN-LAST:event_isSiliaoStateChanged

    private void jiluActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jiluActionPerformed
        HistoryFrame hf = new HistoryFrame(myname + "查看聊天记录");
        hf.setLocationRelativeTo(jilu);
        hf.setVisible(true);
        hf.writerJiluToPane(1, myname + ".txt");

    }//GEN-LAST:event_jiluActionPerformed

    private void chakanyonghuMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_chakanyonghuMouseEntered
        systishi.setText("选择该选项，双击在线用户列表中的用户可以查看用户资料");
    }//GEN-LAST:event_chakanyonghuMouseEntered

    private void chakanyonghuMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_chakanyonghuMouseExited
        systishi.setText("与用户聊天，请不要忘记选中聊天对象的选项哦");
    }//GEN-LAST:event_chakanyonghuMouseExited

    private void jRadioButton3MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jRadioButton3MouseEntered
        systishi.setText("选择该选项，双击在线用户列表中的用户可以给对方发送文件哦");
    }//GEN-LAST:event_jRadioButton3MouseEntered

    private void jRadioButton3MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jRadioButton3MouseExited
        systishi.setText("与用户聊天，请不要忘记选中聊天对象的选项哦");
    }//GEN-LAST:event_jRadioButton3MouseExited

    private void tirenMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tirenMouseEntered
        systishi.setText("选择该选项，双击在线用户列表中的用户可以给坏蛋踢除聊天室哦");
    }//GEN-LAST:event_tirenMouseEntered

    private void tirenMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tirenMouseExited
        systishi.setText("与用户聊天，请不要忘记选中聊天对象的选项哦");
    }//GEN-LAST:event_tirenMouseExited

    private void liaotianItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_liaotianItemStateChanged
        caozuo = 1;
        systishi.setText("选中后，点击在线用户列表中的用户，就可以快速跟你想聊天的人聊天了哦");
    }//GEN-LAST:event_liaotianItemStateChanged

    private void chakanyonghuItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_chakanyonghuItemStateChanged
        caozuo = 2;
        systishi.setText("选中后，点击在线用户列表中的用户，就可以对方的资料哦");
    }//GEN-LAST:event_chakanyonghuItemStateChanged

    private void jRadioButton3ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButton3ItemStateChanged
        caozuo = 3;
        systishi.setText("选中后，点击在线用户列表中的用户，就可以给对方传送文件哦");
    }//GEN-LAST:event_jRadioButton3ItemStateChanged

    private void tirenItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_tirenItemStateChanged
        caozuo = 4;
        systishi.setText("选中后，点击在线用户列表中的用户，就可以踢人哦");
    }//GEN-LAST:event_tirenItemStateChanged

    private void jLabel2MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel2MouseEntered
        systishi.setText("有没有心仪的对象，赶快给他/她送花吧");
    }//GEN-LAST:event_jLabel2MouseEntered

    private void jLabel2MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel2MouseExited
        systishi.setText("心缘聊天室欢迎您的加入，祝您聊天愉快");
    }//GEN-LAST:event_jLabel2MouseExited

    private void songhuaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_songhuaActionPerformed
        String str = huacount.getText();
        if (str.length() == 0) {
            JOptionPane.showMessageDialog(null, "送花数量不能为空！请重新输入！");
            return;
        }
        boolean flag = false;
        for (int i = 0; i < str.length(); i++) {

            for (int j = 0; j <= 9; j++) {
                if ((str.charAt(i) + "").equals(j + "")) {
                    flag = true;
                }
            }
            if (!flag) {
                JOptionPane.showMessageDialog(null, "您不能输入非数字字符！");
                return;
            }
        }

        out.println("songhua&" + myname + "&" + toWho.getSelectedItem().toString() + "&" + str);
        out.flush();
    }//GEN-LAST:event_songhuaActionPerformed
    public void send() {// 发送消息到服务器
        msgg.setContent(ChatFilter.getAfterFilterString(message.getText()));
        msgg.setDaxiao(daxiao.getSelectedItem().toString());
        msgg.setDongzuo(dongzuo.getSelectedItem().toString());
        msgg.setFromWho(myname);
        msgg.setIsSiliao(privateTalkFlag ? 1 : 0);
        msgg.setSendTime(DateUtil.getCurrentTimestamp());
        msgg.setToWho(toWho.getSelectedItem().toString());
        msgg.setYangshi(yangshi.getSelectedItem().toString());
        msgg.setYanse(yanse.getSelectedItem().toString());
        msgg.setZiti(ziti.getSelectedItem().toString());
        Chat.sendMessage(out, msgg, message);
    }

    @Override
    public void run() {
        boolean flag = true;
        while (flag) {
            String msgs = null;
            SendFileJFrame sf = null;
            try {
                msgs = in.readLine();// 接收服务器发来的string信息
                if (msgs != null) {
                    System.out.println("【客户端接受到的消息】" + myname + "客户端收到服务器发来的消息：" + msgs);
                    if (msgs.startsWith("oldUserList")) {//发来的已经登录的用户列表
                        String str[] = msgs.split("&");
                        listUser.removeAllElements();
                        listUser.addElement(str[1] + " 〖" + str[2] + "〗"); // 更新用户列表
                        usercount.setText("在线人数：" + str[3]);
                    } else if (msgs.startsWith("newAddUser")) {// 新进入一个用户
                        String str[] = msgs.split("&");
                        Chat.sysXiaoxi(gongliao, "【系统消息】：" + str[1] + "上线了", Color.red, 17);
                        listUser.addElement(str[1] + " 〖" + str[2] + "〗"); // 更新用户列表
                        usercount.setText("在线人数：" + str[3]);
                    } else if (msgs.startsWith("quit")) {  //退出
                        String[] s = msgs.split("&");
                        Chat.sysXiaoxi(gongliao, "【系统消息】：" + s[1] + s[2], Color.red, 17);
                        if (s[1].equals(myname)) {
                            JOptionPane.showMessageDialog(null, "您已经被剔除了聊天室，请重新登录");
                            dispose();
                            LoginFrame.main(new String[]{"a"});
                        }
                        this.toWho.removeItem(s[1]);
                        usercount.setText("在线人数：" + s[3]);
                        out.println("flush");
                        out.flush();
                    } else if (msgs.startsWith("ip")) {  //获得 给发送文件的ip地址
                        String str[] = msgs.split("&");//str[1] ip地址  str[2] 发给谁
                        sf = new SendFileJFrame(myname, str[2], str[1], out, gongliao);
                        sf.setLocationRelativeTo(userList);
                        sf.setVisible(true);

                    } else if (msgs.startsWith("receivefile")) {//收到接收文件
                        String str[] = msgs.split("&");//("receivefile&" + toName + "&" + this.myname + "&" + fd.getFile().toString() + "&" + this.toIp);

                        if (str[1].equals(myname)) {
                            int response = JOptionPane.showConfirmDialog(null, "是否接收" + str[2] + "给您发来的文件" + str[3], str[2] + "给您发来文件", JOptionPane.YES_NO_OPTION);
                            System.err.println(response + "^^^^^^^^^^^^^^^^^^^^^^");
                            if (response == 0) {//选择接收
                                try {
                                    SendFileJFrame.receiveFile(str[4], str[3], 1,gongliao);                                    
                                } catch (Exception ee) {
                                }

                            } else if (response == 1) {//拒绝接收
                                SendFileJFrame.receiveFile(str[4], str[3], 0,gongliao);
                                System.out.println("您拒绝接受文件");
                            }
                        }
                    } else if (msgs.startsWith("detailOfUser")) {//用户的详细资料
                        System.err.println("查看用户资料窗口打开监听");
                        String str[] = msgs.split("&");
                        DetailOfUserFrame duf = new DetailOfUserFrame(str[3], str[5], str[4], str[8], str[7], str[6]);
                        duf.setLocationRelativeTo(userList);
                        duf.setVisible(true);
                    } else if (msgs.startsWith("guanggao")) {//收到的是广告信息
                        guanggao.setText(msgs.split("&")[1]);
                        guanggao.setForeground(Color.blue);
                    } 
                    else if(msgs.startsWith("gonggao")){//如果收到的是系统发来的公告
                         String str[] = msgs.split("&");
                         Chat.sysXiaoxi(gongliao, "【系统发来公告信息】:"+str[1], Color.blue, 18);
                    }
                    else if (msgs.startsWith("songhua")) {//送花的标志
                        MessageModel mg = new MessageModel();
                        mg.setZiti("宋体");
                        mg.setDaxiao("16");
                        mg.setYanse("红色");
                        mg.setYangshi("常规");
                        String str = null;
                        String temp[] = msgs.split("&");
                        if (temp[1].equals(myname)) {//如果是我送的花
                            str = "我  送给  " + temp[2] + "  " + temp[3] + "朵  ";
                            mg.setContent("#sh");
                            Chat.inserts(siliao, str, mg, message);
                        } else if (temp[2].equals(myname)) {//送给我的鲜花
                            str = temp[1] + "  送给  我  " + "  " + temp[3] + "朵  ";
                            mg.setContent("#sh");
                            Chat.inserts(siliao, str, mg, message);
                        }
                        str = temp[1] + "  送给  " + temp[2] + "  朵  ";
                        mg.setContent("#sh");
                        Chat.inserts(gongliao, str, mg, message);
                    } else if (msgs.startsWith("liaotianxinxi")) {//如果是聊天的信息,普通的聊天信息
                        System.out.println(msgs);
                        String str = null;
                        MessageModel mg = MessageModel.getMsgByString(msgs);

                        if (mg.getIsSiliao() == 1) {//判断该条聊天信息是否是私聊信息，==1 是表示私聊信息，私聊信息只发送到，发送人和接收人
                            if (mg.getToWho().equals(myname)) {//如果是发送给我的消息
                                if (!mg.getFromWho().equals(myname)) {
                                    str = mg.getFromWho() + " 对  您  说:";
                                    if (!mg.getDongzuo().equals("无")) {
                                        str = mg.getFromWho() + " 对  您  " + mg.getDongzuo() + "  说:";
                                    }
                                    Chat.inserts(siliao, str, mg, message);
                                }
                            }
                            if (mg.getFromWho().equals(myname)) {
                                str = "我" + " 对  " + mg.getToWho() + " 说:";
                                if (!mg.getDongzuo().equals("无")) {
                                    str = "我" + " 对 " + mg.getToWho() + "  " + mg.getDongzuo() + " 说:";
                                }
                                Chat.inserts(siliao, str, mg, message);
                            }
                        } else {
                            if (mg.getToWho().equals(myname)) {//如果是发送给我的消息
                                if (!mg.getFromWho().equals(myname)) {
                                    str = mg.getFromWho() + " 对  您  说:";
                                    if (!mg.getDongzuo().equals("无")) {
                                        str = mg.getFromWho() + " 对 您  " + mg.getDongzuo() + "说:";
                                    }
                                    Chat.inserts(siliao, str, mg, message);
                                }
                            }
                            if (mg.getFromWho().equals(myname)) {
                                str = "我" + " 对 " + mg.getToWho() + " 说:";
                                if (!mg.getDongzuo().equals("无")) {
                                    str = "我" + " 对 " + mg.getToWho() + "  " + mg.getDongzuo() + " 说:";
                                }
                                Chat.inserts(siliao, str, mg, message);
                            }
                            str = mg.getFromWho() + " 对 " + mg.getToWho() + " 说:";
                            if (!mg.getDongzuo().equals("无")) {
                                str = mg.getFromWho() + " 对 " + mg.getToWho() + "  " + mg.getDongzuo() + " 说:";
                            }
                            String ltjilu = Chat.inserts(gongliao, str, mg, message);
                            FileForJiluUtil.appendJiluToFile(myname + ".txt", ltjilu + "\n");
                            ////////下面是将聊天信息放入到文本文件中，以供用户读取
                        }

                    }
                }
            } catch (Exception e) {
                flag = false;
                e.printStackTrace();
            }
        }

    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel aaaaa;
    private javax.swing.JLabel act;
    private javax.swing.JButton biaoqing;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JRadioButton chakanyonghu;
    private javax.swing.JButton clear;
    private javax.swing.JComboBox daxiao;
    private javax.swing.JComboBox dongzuo;
    private javax.swing.JPanel font;
    private javax.swing.JTextPane gongliao;
    private javax.swing.JLabel guanggao;
    private javax.swing.JButton hanhua;
    private javax.swing.JTextField huacount;
    private javax.swing.JCheckBox isSiliao;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JRadioButton jRadioButton3;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JButton jietu;
    private javax.swing.JButton jilu;
    private javax.swing.JScrollPane jsp1;
    private javax.swing.JRadioButton liaotian;
    private javax.swing.JTextArea message;
    private javax.swing.JButton send;
    private javax.swing.JTextPane siliao;
    private javax.swing.JButton songhua;
    private javax.swing.JLabel systishi;
    private javax.swing.JRadioButton tiren;
    private javax.swing.JComboBox toWho;
    private javax.swing.JList userList;
    private javax.swing.JLabel usercount;
    private javax.swing.JButton xzziti;
    private javax.swing.JComboBox yangshi;
    private javax.swing.JComboBox yanse;
    private javax.swing.JComboBox ziti;
    // End of variables declaration//GEN-END:variables

    public JRadioButton getTiren() {
        return tiren;
    }

    public void setTiren(JRadioButton tiren) {
        this.tiren = tiren;
    }

    public JTextPane getGongliao() {
        return gongliao;
    }

    public void setGongliao(JTextPane gongliao) {
        this.gongliao = gongliao;
    }
}
